/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.triumphsys.icici.cmeeting.portlet.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import com.triumphsys.icici.cmeeting.portlet.model.CMParameter;
import com.triumphsys.icici.cmeeting.portlet.model.CMParameterModel;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.Date;

/**
 * The base model implementation for the CMParameter service. Represents a row in the &quot;CM_PARAMETER_MASTER&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.triumphsys.icici.cmeeting.portlet.model.CMParameterModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link CMParameterImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a c m parameter model instance should use the {@link com.triumphsys.icici.cmeeting.portlet.model.CMParameter} interface instead.
 * </p>
 *
 * @author Triumphsys
 * @see CMParameterImpl
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMParameter
 * @see com.triumphsys.icici.cmeeting.portlet.model.CMParameterModel
 * @generated
 */
public class CMParameterModelImpl extends BaseModelImpl<CMParameter>
	implements CMParameterModel {
	public static final String TABLE_NAME = "CM_PARAMETER_MASTER";
	public static final Object[][] TABLE_COLUMNS = {
			{ "parameterId", new Integer(Types.BIGINT) },
			{ "companyId", new Integer(Types.BIGINT) },
			{ "groupId", new Integer(Types.BIGINT) },
			{ "userId", new Integer(Types.BIGINT) },
			{ "name", new Integer(Types.VARCHAR) },
			{ "value", new Integer(Types.VARCHAR) },
			{ "description", new Integer(Types.VARCHAR) },
			{ "createDate", new Integer(Types.TIMESTAMP) },
			{ "modifiedBy", new Integer(Types.BIGINT) },
			{ "modifiedDate", new Integer(Types.TIMESTAMP) },
			{ "regionGroupId", new Integer(Types.BIGINT) },
			{ "active_", new Integer(Types.BOOLEAN) }
		};
	public static final String TABLE_SQL_CREATE = "create table CM_PARAMETER_MASTER (parameterId LONG not null primary key,companyId LONG,groupId LONG,userId LONG,name VARCHAR(75) null,value VARCHAR(75) null,description VARCHAR(75) null,createDate DATE null,modifiedBy LONG,modifiedDate DATE null,regionGroupId LONG,active_ BOOLEAN)";
	public static final String TABLE_SQL_DROP = "drop table CM_PARAMETER_MASTER";
	public static final String ORDER_BY_JPQL = " ORDER BY cmParameter.parameterId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CM_PARAMETER_MASTER.parameterId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMParameter"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.triumphsys.icici.cmeeting.portlet.model.CMParameter"),
			true);
	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.triumphsys.icici.cmeeting.portlet.model.CMParameter"));

	public CMParameterModelImpl() {
	}

	public long getPrimaryKey() {
		return _parameterId;
	}

	public void setPrimaryKey(long pk) {
		setParameterId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return new Long(_parameterId);
	}

	public long getParameterId() {
		return _parameterId;
	}

	public void setParameterId(long parameterId) {
		_parameterId = parameterId;
	}

	public long getCompanyId() {
		return _companyId;
	}

	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	public long getGroupId() {
		return _groupId;
	}

	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	public long getUserId() {
		return _userId;
	}

	public void setUserId(long userId) {
		_userId = userId;
	}

	public String getUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
	}

	public void setUserUuid(String userUuid) {
		_userUuid = userUuid;
	}

	public String getName() {
		if (_name == null) {
			return StringPool.BLANK;
		}
		else {
			return _name;
		}
	}

	public void setName(String name) {
		_name = name;
	}

	public String getValue() {
		if (_value == null) {
			return StringPool.BLANK;
		}
		else {
			return _value;
		}
	}

	public void setValue(String value) {
		_value = value;
	}

	public String getDescription() {
		if (_description == null) {
			return StringPool.BLANK;
		}
		else {
			return _description;
		}
	}

	public void setDescription(String description) {
		_description = description;
	}

	public Date getCreateDate() {
		return _createDate;
	}

	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	public long getModifiedBy() {
		return _modifiedBy;
	}

	public void setModifiedBy(long modifiedBy) {
		_modifiedBy = modifiedBy;
	}

	public Date getModifiedDate() {
		return _modifiedDate;
	}

	public void setModifiedDate(Date modifiedDate) {
		_modifiedDate = modifiedDate;
	}

	public long getRegionGroupId() {
		return _regionGroupId;
	}

	public void setRegionGroupId(long regionGroupId) {
		_regionGroupId = regionGroupId;
	}

	public boolean getActive_() {
		return _active_;
	}

	public boolean isActive_() {
		return _active_;
	}

	public void setActive_(boolean active_) {
		_active_ = active_;
	}

	public CMParameter toEscapedModel() {
		if (isEscapedModel()) {
			return (CMParameter)this;
		}
		else {
			return (CMParameter)Proxy.newProxyInstance(CMParameter.class.getClassLoader(),
				new Class[] { CMParameter.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public ExpandoBridge getExpandoBridge() {
		if (_expandoBridge == null) {
			_expandoBridge = ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
					CMParameter.class.getName(), getPrimaryKey());
		}

		return _expandoBridge;
	}

	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		getExpandoBridge().setAttributes(serviceContext);
	}

	public Object clone() {
		CMParameterImpl cmParameterImpl = new CMParameterImpl();

		cmParameterImpl.setParameterId(getParameterId());

		cmParameterImpl.setCompanyId(getCompanyId());

		cmParameterImpl.setGroupId(getGroupId());

		cmParameterImpl.setUserId(getUserId());

		cmParameterImpl.setName(getName());

		cmParameterImpl.setValue(getValue());

		cmParameterImpl.setDescription(getDescription());

		cmParameterImpl.setCreateDate(getCreateDate());

		cmParameterImpl.setModifiedBy(getModifiedBy());

		cmParameterImpl.setModifiedDate(getModifiedDate());

		cmParameterImpl.setRegionGroupId(getRegionGroupId());

		cmParameterImpl.setActive_(getActive_());

		return cmParameterImpl;
	}

	public int compareTo(CMParameter cmParameter) {
		int value = 0;

		if (getParameterId() < cmParameter.getParameterId()) {
			value = -1;
		}
		else if (getParameterId() > cmParameter.getParameterId()) {
			value = 1;
		}
		else {
			value = 0;
		}

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		CMParameter cmParameter = null;

		try {
			cmParameter = (CMParameter)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		long pk = cmParameter.getPrimaryKey();

		if (getPrimaryKey() == pk) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return (int)getPrimaryKey();
	}

	public String toString() {
		StringBundler sb = new StringBundler(25);

		sb.append("{parameterId=");
		sb.append(getParameterId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", name=");
		sb.append(getName());
		sb.append(", value=");
		sb.append(getValue());
		sb.append(", description=");
		sb.append(getDescription());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", modifiedBy=");
		sb.append(getModifiedBy());
		sb.append(", modifiedDate=");
		sb.append(getModifiedDate());
		sb.append(", regionGroupId=");
		sb.append(getRegionGroupId());
		sb.append(", active_=");
		sb.append(getActive_());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(40);

		sb.append("<model><model-name>");
		sb.append("com.triumphsys.icici.cmeeting.portlet.model.CMParameter");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>parameterId</column-name><column-value><![CDATA[");
		sb.append(getParameterId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>name</column-name><column-value><![CDATA[");
		sb.append(getName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>value</column-name><column-value><![CDATA[");
		sb.append(getValue());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>description</column-name><column-value><![CDATA[");
		sb.append(getDescription());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedBy</column-name><column-value><![CDATA[");
		sb.append(getModifiedBy());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
		sb.append(getModifiedDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>regionGroupId</column-name><column-value><![CDATA[");
		sb.append(getRegionGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>active_</column-name><column-value><![CDATA[");
		sb.append(getActive_());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private long _parameterId;
	private long _companyId;
	private long _groupId;
	private long _userId;
	private String _userUuid;
	private String _name;
	private String _value;
	private String _description;
	private Date _createDate;
	private long _modifiedBy;
	private Date _modifiedDate;
	private long _regionGroupId;
	private boolean _active_;
	private transient ExpandoBridge _expandoBridge;
}